def main():
    y_or_n = input("是否退出程序（退出请输入yes，否则输入no）？")
    while (y_or_n == "no"):
        print("请输入以下个人信息，中间用空格隔开")
        person_str = input("性别：体重（kg）：身高（cm）：年龄：")
        person = person_str.split(" ")
        try:
            gender = person[0]
            weight = float(person[1])
            height = float(person[2])
            age = int(person[3])
            if 0 < age <= 150:
                human_age = age
                if 0 < weight <= 1000:
                    human_weight = weight
                    if 0 < height <= 400:
                        human_height = age
                        if gender == "男":
                            gmr = 13.7 * weight + 5.0 * height - 6.8 * age + 66
                        elif gender == "女":
                            gmr = 9.6 * weight + 3.8 * height - 4.7 * age + 655
                        else:
                            gmr = -1
                        if gmr != -1:
                            print("您的性别为{}，体重为{}kg，身高为{}cm，年龄为{}岁".format(gender, weight, height, age))
                            print("您的基础代谢率为{}大卡".format(gmr))
                        else:
                            print("暂不支持该性别！")
                    else:
                     print("请输入正确的身高！")
                else:
                 print("请输入正确的体重！")
            else:
             print("输入的年龄应在0-150之间！")
        except ValueError:
            print("请输入正确的个人信息！")
        except IndexError:
            print("请输入完整的个人信息！")
        except:
            print("系统有误！")
        print()  # 输出空行
        print('=-------------------------------------------------------=')
        y_or_n = input("是否退出程序（退出请输入yes）？")


if __name__ == "__main__":
    main()